﻿<Window x:Class="winEditors"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:Caps.Console" 
        xmlns:res="clr-namespace:Caps.Console.My.Resources"
        xmlns:convertersT="clr-namespace:Tools.WindowsT.WPF.ConvertersT;assembly=Tools.Windows"
        Title="{x:Static res:Resources.txt_ListEditors}" Height="336" Width="813" ShowInTaskbar="False" Icon="/CapsConsole;component/Resources/Cap.ico">
    <Window.Resources>
        <Style TargetType="TextBox" x:Key="MultilineInGrid">
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="AcceptsReturn" Value="True"/>
            <Setter Property="MinLines" Value="2"/>
        </Style>
        <convertersT:SameTypeOrNullConverter x:Key="NullConverter"/>
    </Window.Resources>
    <Grid  >
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" MinHeight="25" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TabControl Height="auto" Width="auto" Name="tabEditors" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch">
            <TabItem Header="{x:Static res:Resources.txt_Materials}" Name="tapMaterials">
                <DataGrid AutoGenerateColumns="False" Name="dgrMaterials" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding MaterialID, Mode=OneWay}"  />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding Name, Mode=TwoWay}"  />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Shapes}" Name="tapShapes">
                <DataGrid AutoGenerateColumns="False" Name="dgrShapes">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding ShapeID, Mode=OneWay}"  />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Size1Name}" Binding="{Binding Size1Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Size2Name}" Binding="{Binding Size2Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_MainTypes}" Name="tapMainTypes">
                <DataGrid AutoGenerateColumns="False" Name="dgrMainTypes" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding MainTypeID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding TypeName, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding TypeName, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Categories}" Name="tapCategories">
                <DataGrid AutoGenerateColumns="False" Name="dgrCategories" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding CategoryID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding CategoryName, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Types}" Name="tapTypes">
                <DataGrid AutoGenerateColumns="False"  Name="dgrTypes" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding CapTypeID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding TypeName, Mode=TwoWay}"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Shape}" DisplayMemberPath="Name" SelectedItemBinding="{Binding Shape, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcTypes_Shape" SortMemberPath="Name" />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Size1}" Binding="{Binding Size, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Size2}" Binding="{Binding Size2, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Height}" Binding="{Binding Height, Mode=TwoWay}"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Material}" DisplayMemberPath="Name" SelectedItemBinding="{Binding Material, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcTypes_Material" SortMemberPath="Name" />
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_MainType}" DisplayMemberPath="TypeName" SelectedItemBinding="{Binding MainType, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcTypes_MainType" SortMemberPath="TypeName" />
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Target}" DisplayMemberPath="Name" SelectedItemBinding="{Binding Target, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcTypes_Target" SortMemberPath="Name" />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Companies}" Name="tapCompanies">
                <DataGrid AutoGenerateColumns="False" Name="dgrCompanies" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding CompanyID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding CompanyName, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_ProductTypes}" Name="tapProductTypes">
                <DataGrid AutoGenerateColumns="False" Name="dgrProductTypes" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding ProductTypeID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding ProductTypeName, Mode=TwoWay}"/>
                        <DataGridCheckBoxColumn Header="{x:Static res:Resources.coh_IsDrink}" Binding="{Binding IsDrink, Mode=TwoWay}" IsThreeState="True"/>
                        <DataGridCheckBoxColumn Header="{x:Static res:Resources.coh_IsAlcoholic}" Binding="{Binding IsAlcoholic, Mode=TwoWay}" IsThreeState="True"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Products}" Name="tapProducts">
                <DataGrid AutoGenerateColumns="False" Name="dgrProducts" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding ProductID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding ProductName, Mode=TwoWay}"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Company}" DisplayMemberPath="CompanyName" SelectedItemBinding="{Binding Company, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcProduct_Company" SortMemberPath="CompanyName"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_ProductType}" DisplayMemberPath="ProductTypeName" SelectedItemBinding="{Binding ProductType, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcProduct_ProductType" SortMemberPath="ProductTypeName" />
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Storages}" Name="tapStorages">
                <DataGrid AutoGenerateColumns="False" Name="dgrStorages">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding StorageID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Number}" Binding="{Binding StorageNumber, Mode=TwoWay}"/>
                        <DataGridCheckBoxColumn Header="{x:Static res:Resources.coh_HasCaps}" Binding="{Binding HasCaps, Mode=TwoWay}"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Type}" DisplayMemberPath="Name" SelectedItemBinding="{Binding StorageType, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcStorage_StorageType" SortMemberPath="Name"/>
                        <DataGridComboBoxColumn Header="{x:Static res:Resources.coh_Parent}" DisplayMemberPath="StorageNumber" SelectedItemBinding="{Binding ParentStorage, Mode=TwoWay, Converter={StaticResource NullConverter}}" x:Name="cmcStorage_Parent" SortMemberPath="StorageNumber"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_StorageTypes}" Name="tapStorageTypes">
                <DataGrid AutoGenerateColumns="False" Name="dgrStorageTypes">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding StorageTypeID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_Targets}" Name="tapTargets">
                <DataGrid AutoGenerateColumns="False" Name="dgrTargets">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding TargetID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="{x:Static res:Resources.txt_CapSigns}" Name="tapSigns">
                <DataGrid AutoGenerateColumns="False" Name="dgrSigns" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_ID}" Binding="{Binding CapSignID, Mode=OneWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Name}" Binding="{Binding Name, Mode=TwoWay}"/>
                        <DataGridTextColumn Header="{x:Static res:Resources.coh_Description}" Binding="{Binding Description, Mode=TwoWay}" Width="*" EditingElementStyle="{StaticResource MultilineInGrid}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
        </TabControl>
        <UniformGrid Columns="3" Rows="1"  Height="25" Width="Auto" Grid.Row="1">
            <Button Name="btnOK" Width="auto" HorizontalAlignment="Center" Padding="3,0,3,0" Content="{x:Static res:Resources.cmd_OK}" />
            <Button Name="btnApply" Width="auto" HorizontalAlignment="Center" Padding="3,0,3,0" Content="{x:Static res:Resources.cmd_Apply}"/>
            <Button Name="btnCancel" Width="auto" HorizontalAlignment="Center"  Padding="3,0,3,0" IsCancel="True" Content="{x:Static res:Resources.cmd_Cancel}"/>
        </UniformGrid>
    </Grid>
</Window>
